package com.yisu.expressway.push;

import android.content.Context;

import com.igexin.sdk.PushManager;

/**
 * Created by shijunfeng on 2016/12/23.
 */
public class GetPushManager {
    private static GetPushManager sInstance;

    private GetPushManager() {

    }

    public static GetPushManager getInstance() {
        if (null == sInstance) {
            synchronized (GetPushManager.class) {
                if (null == sInstance) {
                    sInstance = new GetPushManager();
                }
            }
        }
        return sInstance;
    }

    public void init(Context context) {
        PushManager.getInstance().initialize(context, GetPushService.class);
        PushManager.getInstance().registerPushIntentService(context, GetIntentService.class);
    }

    public String getClientid(Context context){
        return PushManager.getInstance().getClientid(context);
    }
    public void stopService(Context context) {
        PushManager.getInstance().stopService(context);
    }

    public void turnOn(Context context) {
        PushManager.getInstance().turnOnPush(context);
    }

    public void turnOff(Context context) {
        PushManager.getInstance().turnOffPush(context);
    }

    public boolean isTurnedOn(Context context) {
        return PushManager.getInstance().isPushTurnedOn(context);
    }

    public boolean feedbackMsg(Context context,String taskid,String messageid,int actionid){
        return PushManager.getInstance().sendFeedbackMessage(context,taskid,messageid,actionid);
    }

}
